package JVM.init;

public class MyTest1 {
	
	public static void main(String[] args) {
		Singleton single = Singleton.getInstance();
		System.out.println(Singleton.counter1);//1
		System.out.println(Singleton.counter2);//0
	}

}

class Singleton{
	
	private static Singleton single = new Singleton();
	public static int counter1;
	public static int counter2 = 0;
	
	private Singleton(){
		counter1++;
		counter2++;
	}
	
	public static Singleton getInstance(){
		return single;
	}
}

